#ifndef FUNCTIONS_H
#define FUNCTIONS_H

#include "Globals.h"

using namespace std;

class Functions{
public:

//*********************************************************************************************

BYTE* _remNOP_()
{
    //NULLs most NOPs (0x90->0x0)
    long lFileBufferSize = fileSize;
    for(int i=0;i<=lFileBufferSize+1;i++)
    {
       if((bFileBuffer[i]==0x90) && (bFileBuffer[i+1]==0x90))
                 {bFileBuffer[i]=0x0; bFileBuffer[i+1]=0x0;}
    }
}

long _fFileSize(FILE *file)
{     
	long lCurPos, lEndPos;
	lCurPos = ftell(file);
	fseek(file, 0, 2);
	lEndPos = ftell(file);
	fseek(file, lCurPos, 0);
	return lEndPos;
}

void _fOpenRead()
{
    if ((fFile = fopen(binIn, "rb+")) == NULL){;} else {;}
}

void _fOpenWrite()
{
    if ((fFileW = fopen(binOut, "wb+")) == NULL){;} else {;}
}

void _fWriteFile()
{
    _fOpenWrite();
    fwrite(bFileBuffer, 1, fileSize, fFileW);     
}

void _fPrint(BYTE *buffer, int count )
{
        for (int i = 0; i < count; i++)     
             cout << buffer[i];
}

};
//*********************************************************************************************


#endif
